﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="buyer_orderAdd.aspx.cs"
    Inherits="PeisongWeb.buyer_orderAdd" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>采购配送首页-下订单</title>
    <!--#include file="../global.inc" -->
    <link rel="stylesheet" href="/app_common/styles/jquery.treeview.css" />
    <link href="/app_common/styles/juqery.ui.1.8.5/ui-lightness/jquery-ui-1.8.5.custom.css" rel="stylesheet" type="text/css" />
    
</head>
<body>
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager1" runat="server">
    </ext:ScriptManager>
    <div id="container">
        <uc1:headerV2 runat="server" ID="header1" />
        <div id="homemain">
            <div id="main">
                <div class="title">
                    <div class="title_text" style="width: 200px;">
                        <ul>
                            <li class="color1">下订单</li>
                            <li class="color2">-<span id="span_mode"><%=mode==1?"菜谱下单":"食材下单"%></span></li>
                        </ul>
                    </div>
                    <div style="overflow: hidden; height: 36px;">
                        <div id="iconNotice" style="float: left; padding-top: 12px;">
                            <img alt="" src="/app_common/images/news.gif" /></div>
                        <div id="marqueebox">
                            <asp:Repeater runat="server" ID="rpt_news">
                                <ItemTemplate>
                                    <div class="title_news" style="width: 720px;">
                                        <ul>
                                            <li title='<%#Eval("text") %>'>
                                                <%#Eval("text") %></li>
                                            <li style='<%#Eval("url").ToString()==""?"display:none": "" %>'><a target="_blank"
                                                href='http://<%#Eval("url") %>'>查看</a></li>
                                        </ul>
                                    </div>
                                </ItemTemplate>
                            </asp:Repeater>
                        </div>
                    </div>
                </div>
                <div class="line_top">
                </div>
                <div id="mainmiddle">
                    <div id="threeColPanel" style="height: 600px; margin-top: 20px;">
                        <div class="categories_1" id="div_1">
                            <div class="cate1" style="clear:left;">
                                <%--<ul>
                                    <li id="mode_1" class='<%=mode==1?"on":"off"%>' style="cursor: pointer;" onclick="tabMenu('mode_1');">
                                        <a>菜谱下单</a> </li>
                                    <li id="mode_2" class='<%=mode==1?"off":"on"%>' style="cursor: pointer" onclick="tabMenu('mode_2');">
                                        <a>食材下单</a> </li>
                                </ul>--%>
                                <ul>
                                    <li id="mode_1" style="cursor: pointer;" onclick="tabMenu('mode_1');">
                                        <a>菜谱下单</a> </li>
                                    <li id="mode_2"  style="cursor: pointer" onclick="tabMenu('mode_2');">
                                        <a>食材下单</a> </li>
                                </ul>
                                
                            </div>
                            <%--
                            <div id="order_mode_1" style='<%=mode==1?"": "display:none"%>; clear:left;'>
                            --%>
                            <div id="order_mode_1" style=' clear:left;'>
                                <div>
                                    <div class="categories_button">
                                        <ul>
                                            <li style="cursor: pointer" onclick="getListByRecipeList();">确认</li>
                                            <li onclick="chkReset();" style="cursor: pointer">重置</li>
                                        </ul>
                                    </div>
                                    <div style="float: left; clear: both; border-bottom: 1px dashed #dcdcdc; width: 240px;
                                        margin-left: 5px; height: 1px; overflow: hidden; zoom: 1; margin-top: 10px; display: inline;">
                                    </div>
                                    <div style="float: left; clear: both; overflow-y: auto; width: 176px;">
                                        <div align="left">
                                            <ul id="browser" class="filetree">
                                                <asp:Repeater runat="server" ID="rpt_list">
                                                    <ItemTemplate>
                                                        <li class="closed"><span class="folder">
                                                            <%#Eval("name") %></span>
                                                            <ul>
                                                                <%#getRecipeList(Convert.ToInt32(Eval("rcid")))%>
                                                            </ul>
                                                        </li>
                                                    </ItemTemplate>
                                                </asp:Repeater>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <%--
                            <div style="<%=mode==1?"display:none": ""%>;clear:left;" id="order_mode_2">
                            --%>
                            <div style="clear:left;" id="order_mode_2">
                                <div id="accordion">
                                    <!--喜好商品-->
                                    <div>
                                        <h3>
                                            <a href="#"><span id="spantitle">日常订购</span></a></h3>
                                        <div>
                                            <div style="text-align: left; clear: both; margin: 0px; padding: 0px;" id="tree1">
                                                <%--<ext:TreePanel ID="TreePanel3" runat="server" Title="类别列表" Header="false" Width="228"
                                                    Height="460" AutoScroll="true" CollapseFirst="false" ContainerScroll="true" Border="false"
                                                    RootVisible="false">
                                                   <Loader>
                                                        <ext:TreeLoader DataUrl="buyer_GeneralProduct.ashx" RequestMethod="GET" />
                                                    </Loader>
                                                    <Root>
                                                        <ext:AsyncTreeNode NodeID="0,0" Text="所有类别" />
                                                    </Root>
                                                </ext:TreePanel>--%>
                                                <div id="TreePanel3_Container"></div>
                                                
                                            </div>
                                        </div>
                                    </div>
                                    <!--常规商品-->
                                    <div id="div_all">
                                        <h3>
                                            <a href="#">全品项商品</a></h3>
                                        <div>
                                            <div style="text-align: left; clear: both; margin: 0px; padding: 0px;"  id="tree2">
                                               <%-- <ext:TreePanel ID="TreePanel1" runat="server" Title="类别列表" Header="false" Width="228"
                                                    Height="460" AutoScroll="true" CollapseFirst="false" ContainerScroll="true" Border="false"
                                                    RootVisible="false">
                                                    <Loader>
                                                        <ext:TreeLoader DataUrl="buyer_ConventionalPrice.ashx" RequestMethod="GET" />
                                                    </Loader>
                                                    <Root>
                                                        <ext:AsyncTreeNode NodeID="0,0" Text="所有类别" />
                                                    </Root>
                                                </ext:TreePanel>--%>
                                                
                                                 <div id="TreePanel1_Container"></div>
                                            </div>
                                        </div>
                                    </div>
                                    <!--特价商品-->
                                    <div id="div_tj">
                                        <h3>
                                            <a href="#">特价商品</a></h3>
                                        <div>
                                            <div style="text-align: left; clear: both; margin: 0px; padding: 0px;"  id="tree3">
                                               <%-- <ext:TreePanel ID="TreePanel2" runat="server" Title="类别列表" Header="false" Width="228"
                                                    Height="460" AutoScroll="true" CollapseFirst="false" ContainerScroll="true" Border="false"
                                                    RootVisible="false">
                                                    <Loader>
                                                        <ext:TreeLoader DataUrl="productSpecialsPrice.ashx" RequestMethod="GET" />
                                                    </Loader>
                                                    <Root>
                                                        <ext:AsyncTreeNode NodeID="0,0" Text="所有类别" />
                                                    </Root>
                                                </ext:TreePanel>--%>
                                                
                                                <div id="TreePanel2_Container"></div>
                                            </div>
                                        </div>
                                    </div>
                                    
                                </div>
                            </div>
                        </div>
                        <div class="categories2" id="div_3" style="width: 655px;">
                            <div class="categories2_title1">
                                <ul>
                                    <li><span style="color: #FF0000">*</span><span>配送时间：
                                        <asp:DropDownList ID="ddl_receiveDt" runat="server">
                                        </asp:DropDownList>
                                    </span>
                                        <asp:Label runat="server" ID="lbl_receiveTime"></asp:Label>
                                        <a href="javascript:delAll();">全删</a></li>
                                </ul>
                            </div>
                            <div class="categories2_table_1" style="width: 100%;">
                                <ul>
                                    <li style="width: 30%; text-align: center; padding-left: 5px; font-weight: bold;">商品名称</li>
                                    <li style="width: 10%; font-weight: bold;">单价(￥)</li>
                                    <li style="width: 15%; font-weight: bold;">数量</li>
                                    <li style="width: 30%; font-weight: bold;">商品备注</li>
                                    <li style="width: 10%; font-weight: bold; text-align: right;">删除</li>
                                </ul>
                            </div>
                            <div class="categories2_list_1" id="div_showSelectPro">
                                <table id="tmpproducts" width="97%" border="0" cellspacing="0" cellpadding="0" style="margin-buttom: 8px;">
                                </table>
                            </div>
                            <div style="float: left; clear: both; border-bottom: 1px dashed #dcdcdc; width: 650px;
                                margin-left: 5px; height: 1px; overflow: hidden; zoom: 1;">
                            </div>
                            <div id="div_show" style="display: block; width: 100%;">
                                <div class="categories2_total" style="text-align: right;">
                                    <span>订购总价： <span id="span_total">0.00</span> 元</span>
                                </div>
                                <div class="categories2_message_1" style="text-align: center;">
                                    <ul>
                                        <li>配送留言：<textarea runat="server" id="txt_orderNote" cols="40" rows="5"></textarea>
                                        </li>
                                    </ul>
                                </div>
                                <div class="categories2_buttom_1" style="text-align: center;">
                                    <div>
                                        <input id="Button1" type="button" runat="server" onclick="javascript:comfirmOrder();"
                                            class="button_red_text button_red5" value="提交订单" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="div_4" style="display: none; padding-top: 10px; padding-bottom: 10px">
                        <div class="column">
                            <ul>
                                <li>配送地点：<asp:Literal runat="server" ID="lblCompanyName"></asp:Literal>&nbsp;&nbsp;&nbsp;<a style="display:none;" href="javascript:$('#divMutilCompany').dialog('open');void(0);">[修改]</a></li>
                            </ul>
                        </div>
                        <div class="search_list">
                            <div class="search_title">
                                <span>订单列表</span>
                            </div>
                            <div class="listsearch">
                                <ul>
                                    <li>配送时间：<span id="sp_psDt"></span></li>
                                    <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;留言： <span id="sp_orderMsg"></span></li>
                                </ul>
                            </div>
                        </div>
                        <div class="list_content">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr class="list_title">
                                    <td width="30%">
                                        商品名称
                                    </td>
                                    <td width="15%">
                                        单价
                                    </td>
                                    <td width="10%">
                                        数量
                                    </td>
                                    <td width="15%">
                                        合计
                                    </td>
                                    <td width="30%">
                                        备注
                                    </td>
                                </tr>
                            </table>
                            <table id="tb_orderItem" border="0" cellspacing="0" cellpadding="0" class="list_border">
                            </table>
                            <div class="list_content">
                                <span style="padding-left: 350px; padding-top: 20px;">
                                    <asp:Button runat="server" ID="lbtn_Submit" Style="width: 90px;" CssClass="button_red_text button_red"
                                        OnClick="lbtn_Submit_Click" OnClientClick="return checkOrder();" Text="提交订单" />
                                    <input type="button" class="button_red_text button_red" value="返回修改" onclick="javascript:returnUpdate();" />
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="login" id="div_5" style="display: none; padding-left: 150px;">
                        <div class="login_title" align="center">
                            <span>预定成功</span>
                        </div>
                        <div class="login_main">
                            <p>
                                &nbsp;</p>
                            <ul class="login_msg">
                                <li>恭喜您</li>
                                <li>您的订单已提交，我们将会以最快速度为您发货！</li>
                                <li>请注意查收！</li>
                                <li style="width: auto">订单号：
                                    <asp:Literal runat="server" ID="lbl_orderno"></asp:Literal>
                                </li>
                                <li>
                                    <input class="button_red_text button_red5" type="button" value="查看订单详情" onclick="javascript:showOrderItem();" />
                                </li>
                            </ul>
                            <p>
                                &nbsp;</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <uc1:footerV2 runat="server" ID="footer1" />
    </div>
    <div class="details" id="dvPanel" style="z-index: 1000;">
        <div class="details_left">
            <img alt="" src="/app_common/images/arrow.png" />
        </div>
        <div class="details_right">
            <div class="details_top">
                <img id="productImage" src="/app_common/images/tp.gif" alt="" />
            </div>
            <div class="details_middle">
                <ul>
                    <li>名 称：<span id="productName"></span></li>
                    <li>单 位：<span id="productUnit"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;规 格：<span
                        id="productStandard"></span></li>
                </ul>
            </div>
            <div class="details_buttom">
                <span>特别提醒：采购商对采购物品有特殊要求的，请在备注里写明，以便供应商配送上采购商满意的货物。</span>
            </div>
        </div>
    </div>
    <input type="hidden" id="hd_SelRecipe" />
    <input runat="server" type="hidden" id="hd_SelPros" />
    <input runat="server" type="hidden" id="hd_psTime" />
    <input runat="server" type="hidden" id="hd_amount" />
    <input runat="server" type="hidden" id="hd_orderid" />
    <input type="hidden" id="hd_loadval" runat="server" />
    <input type="hidden" id="hd_userid" value="<%=logic.customer.userId%>" />
    <input type="hidden" id="hd_systemDate" value="<%= DateTime.Now.ToString() %>" />
    <input type="hidden" id="hd_isTester" runat="server" />
    <input type="hidden" id="hd_companyType" runat="server" />
    <input type="hidden" id="hd_mode" runat="server" />
    <cb:Include ID="buyerOrderJS" runat="server" SetName="buyerOrderAdd" />
    <div id="receiveDtConfirm" title="确认配送时间">
        <b></b>
    </div>
    <div id="divMutilCompany" title="变更配送地点">
        <p>配送地点：<asp:DropDownList runat="server" ID="ddlMutilCompany" DataTextField="companyName" DataValueField="companyId"></asp:DropDownList></p>
    </div>
    </form>
</body>
</html>
